var vm = new Vue({
    el:"#app",
    data(){
        return {
            UserName:'',
            Now:''
        }
    },
    created(){
        this.initThisPage();
    },
    methods:{
        initThisPage(){
            var self = this;
            $.ajax({
                url: "./goLogin/initIndexPage", //请求的url地址
                xhrFields: {
                    withCredentials: true
                },
                dataType: "json", //返回格式为json
                type: "GET", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                beforeSend: function() {
                    //请求前的处理
                },
                success: function(data) {
                    if(data.Status==0){
                        // top.location.href = "../../login.html";
                        window.location.href="../../login.html";
                    }else{
                        self.UserName = data.UserName;
                        self.Now = data.now;
                    }
                },
                complete: function() {
                    //请求完成的处理
                },
                error: function() {}
            });
        }
    }
})